-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3187: Don't crash in requiredClass if class is missing #3748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I know this could be improved (e.g. trying to relate error messages to source), but I won't have the time to sink more effort into this. |
It's possible to check for errors without positions by putting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
@@ -277,7 +277,7 @@ object Denotations { | |||
disambiguate(p) match { | |||
case m @ MissingRef(ownerd, name) => | |||
if (generateStubs) { | |||
m.ex.printStackTrace() | |||
if (ctx.settings.YdebugMissingRefs.value) m.ex.printStackTrace() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check should also be done at https://github.com/lampepfl/dotty/blob/67e34d7674f03b48c863322bba8ac02893d0b554/compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala#L412 instead of ctx.debug
Somehow the tests compiled with an optimized compiler fail with: [error] Test dotty.tools.ShowClassTests.loadDotty failed: java.lang.AssertionError: assertion failed: stubs found: 36, expected: 5
[error] stubs: class Stream,class Seq,class BufferedIterator,class Iterator,class List,class Iterable,class TraversableOnce,class IndexedSeq,class Vector,class Range,class StringBuilder,module mutable,class ::,module immutable,class Traversable,class Set,class Map,module immutable,class Stream,class Seq,class BufferedIterator,class Iterator,class List,class Iterable,class TraversableOnce,class IndexedSeq,class Vector,class Range,class StringBuilder,module mutable,class ::,module immutable,class Traversable,class Set,class Map,module immutable, took 0.043 sec
[error] at dotty.DottyPredef$.assertFail(DottyPredef.scala:39)
[error] at dotty.tools.ShowClassTests.showPackage$$anonfun$4(ShowClassTests.scala:82)
[error] at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
[error] at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
[error] at dotty.tools.ShowClassTests.doTwice(ShowClassTests.scala:58)
[error] at dotty.tools.ShowClassTests.showPackage(ShowClassTests.scala:83)
[error] at dotty.tools.ShowClassTests.loadDotty(ShowClassTests.scala:145)
[error] ... |
@OlivierBlanvillain Can you help debug this? |
I couldn't reproduce on my laptop, I will give it another shot when I'm back in Lausanne |
I finally managed to isolate that bug. The neg test case added in this PR breaks The problem comes from I'm not sure what would be the best solution here, I guess we could remove either |
No, I think that's a real issue you found, we shouldn't have a shared mutable stub list, it should be per-compiler at the very least. |
This list of stubs is only used for testing, in |
Also, issue stacktraces for missing refs only if Y-debug-missing-refs is set. The test case issues error messages without positions, so it is left in `pos`.
This tests was already mostly disabled. The part that was left is also outdated: it checked that the dotty package creates less than 5 stubs, when in current states it creates 0 stubs.
3bdfc00
to
df28080
Compare
Also, issue stacktraces for missing refs only if Y-debug-missing-refs is set.
The test case issues error messages without positions, so it is left in
pos
.